import axios from "axios";
import React, { useState,  useEffect } from "react";
import './index.scss'

function App() {

    const [proList, setProList] = useState([])

    const [count, setCount] = useState(1)


    // 这样写就相当于生命周期的挂载阶段执行
    useEffect(() => {
        axios.get('http://121.89.205.189:3000/api/pro/list').then(res => {
            setProList(res.data.data)
        })
    }, [])

    const [cla, setCla] = useState("animate__animated animate__bounceInDown animate__infinite")

    return <div>
        <h1 className="rotate">App</h1>

        <div className={cla}>哈哈哈</div>

        <button onClick={() => {
            setCount(count + 1)
            setCla('')
        }}>下一页</button>
        <ol>
            {proList && proList.map((item) => {
                return <li key={item.proid}>{item.proname}</li>
            })}

        </ol>
    </div>
}


export default App